import React, { Component } from 'react'

export default class App extends Component {

data = ["java","react","vue"]

  render() {
    return (
      <div>
        <h1 ref={el=>this.h1=el}>{}</h1>
        <ul>
          {
            this.data.map((item,index)=>{
              return <li onClick={()=>{this.h1.innerText=item}} key={index}>{item}</li>
            })
          }
        </ul>
      </div>
    )
  }
}

